import  React,{Component} from  'react'
import  '../../css/new/newlist_ul.css'

const data=require("./data.json")
export  default  class NewList extends  Component{
    constructor(props){
        super(props)
        var nr=this.props.getmsg()
        this.state={
            obj:data.data[nr].wz
        }
    }
    componentWillReceiveProps(nextProps){
        var nr=this.props.getmsg()
        this.setState({
            obj:data.data[nr].wz
        })
    }
    render(){
        return  (
            <ul className="newlist_ul">
                {
                    this.state.obj.map(function(v,i){
                        return (
                            <li key={i}>
                                <img src={v.img} alt=""/>
                                <div className="right_box">
                                    <p>{v.title}</p>
                                    <p>{v.nr}</p>
                                </div>
                            </li>
                        )
                    })

                }
            </ul>
        )
    }
}